"use strict";

/**
 * 首頁腳本
 */
// 首頁輪播
var indexSlide = new Swiper('#j-slide', {
  autoplay: true,
  loop: true,
  pagination: {
    el: '.slide-pos',
    bulletActiveClass: 'active',
    clickable: true
  },
  navigation: {
    nextEl: '.next',
    prevEl: '.prev'
  },
  wrapperClass: 'slide-list',
  slideClass: 'slide-item',
  slideActiveClass: 'slide-active'
});
var gameRecSlide = new Swiper('#j-game-rec-slide', {
  slidesPerView: 'auto',
  centeredSlides: true,
  loop: true,
  pagination: {
    el: '.game-rec-pos',
    bulletActiveClass: 'active',
    clickable: true
  },
  navigation: {
    nextEl: '.game-rec-next',
    prevEl: '.game-rec-prev'
  },
  wrapperClass: 'j-swiper-wrapper',
  slideClass: 'j-swiper-slide',
  slideActiveClass: 'active'
});
var gameBookingSlide = new Swiper('#j-game-booking-slide', {
  slidesPerView: 'auto',
  centeredSlides: true,
  loop: true,
  pagination: {
    el: '.game-booking-pos',
    bulletActiveClass: 'active',
    clickable: true
  },
  navigation: {
    nextEl: '.game-booking-next',
    prevEl: '.game-booking-prev'
  },
  wrapperClass: 'j-swiper-wrapper',
  slideClass: 'j-swiper-slide',
  slideActiveClass: 'active'
});
window.addEventListener('resize', function () {
  window.requestAnimationFrame(function () {
    indexSlide.update();
    gameRecSlide.update();
    gameBookingSlide.update();
  });
}, false);